﻿fastCSharp.GetViewTitle=function()	{	return '=@noticeHeader '+document.title;	};
var ImageSize=	{
Set:function(Image)
	{
	if(Image.width>500)
		{
		Image.className='ContentImg';
		fastCSharp.$AddEvent(Image,['click'],fastCSharp.ThisEvent(this,this.Open,[Image.src]));
		}
//	if(Image.height>400)	Image.height=400;
	},
Open:function(Event,Src)
	{
	open(Src,'_blank');
	}
};

Number.prototype.To1024=function()
	{
	if(this<10000)	return this;
	if(this<1000*1000)	return Math.floor(this/1000)+'k';
	if(this<1000*1000*10)	return Math.floor(this/100000)/10+'m';
	if(this<1000*1000*1000)	return Math.floor(this/1000000)+'m';
	if(this<1000*1000*1000*10)	return Math.floor(this/100000000)/10+'g';
	return Math.floor(this/1000000000)+'g';
	};

var diantou={};
diantou.page=function(Value)
	{
	fastCSharp.Copy(this,Value);
	this.PageCount=Math.floor((this.Count+this.Size-1)/this.Size);
	if(this.Page>1)
		{
		if(this.Page>this.PageCount)	this.Page=this.PageCount||1;
		}
	else this.Page=1;
	this.IsPrevious=this.Page>1;
	this.IsNext=this.Page<this.PageCount;
	this.Pages=[];
	var Start=this.Page-5,End=this.Page+5;
	if(Start<=0)	End-=Start;
	if(End>=this.PageCount)
		{
		Start-=End-this.PageCount;
		End=this.PageCount;
		}
	if(Start<=0)	Start=1;
	while(Start<=End)	this.Pages.push(Start++);
	fastCSharp.Copy(diantou.page.PageInfo,this);
	};
diantou.page.PageInfo={};
diantou.page.prototype={
IsPages:function()	{	return this.Pages.length;	},
SetQuery:function(Name,Value,IsShow)
	{
	fastCSharp.Query[Name]=Value;
	if(IsShow==null||IsShow)	this.ShowPage(1);
	},
ChangeQuery:function(Name)
	{
	fastCSharp.Query[Name]=fastCSharp.Query[Name]==null?0:(fastCSharp.Query[Name]=='false'||fastCSharp.Query[Name]=='0'||!fastCSharp.Query[Name]);
	this.ShowPage(1);
	},
ShowPage:function(Page)
	{
	fastCSharp.Query.page=Page<1?1:(this.PageCount&&Page>this.PageCount?this.PageCount:Page);
	location='#!'+(fastCSharp.LocationHash=fastCSharp.ToQuery(fastCSharp.Query));
	fastCSharp.AjaxGet(fastCSharp.ThisFunction(fastCSharp,fastCSharp.LoadHash),document.location.pathname+'&__REVIEW__=',fastCSharp.Query,null,1);
	}
		};

diantou.path=function()
	{
	this.TodayQuestion='/today.html';
	this.OnlineJudgeAllProblemPath='/onlineJudge/problemList.html';
	this.OnlineJudgeExpiredProblemPath='/onlineJudge/expiredProblemList.html';
	this.OnlineJudgeStatusPath='/onlineJudge/judgeStatus.html';
	this.OnlineJudgeRankPath='/onlineJudge/rankList.html';
	this.ContestListPath='/contest/list.html';
	this.ContestRankPath='/contest/rankList.html';
	this.ExternalContestEdit='/contest/edit.html';
	this.ExternalContestListPath='/contest/externalList.html';
	this.TutorialListPath='/tutorial/list.html';
	this.EnterpriseIndex='/enterprise/index.html';
	this.EnterpriseLoginError='/enterprise/error.html';
	this.EnterpriseLoginErrorIgnoreLoad=1;
	this.EnterpriseRadioEdit='/enterprise/singleEdit.html';
	this.EnterpriseMultipleChoiceEdit='/enterprise/mutiEdit.html';
	this.EnterpriseQuestionEdit='/enterprise/qaEdit.html';
	this.EnterpriseRadioList='/enterprise/singleList.html';
	this.EnterpriseMultipleChoiceList='/enterprise/mutiList.html';
	this.EnterpriseQuestionList='/enterprise/qaList.html';
	this.EnterpriseProblemList='/enterprise/problemList.html';
	this.EnterprisePrivateProblemList='/enterprise/privateProblemList.html';
	this.EnterpriseExamEdit='/enterprise/examDescription.html';
	this.EnterpriseExamList='/enterprise/examList.html';
	this.EnterpriseReviewUserList='/enterprise/examinerList.html';
	this.EnterpriseJobEdit='/enterprise/jobEdit.html';
	this.EnterpriseJobList='/enterprise/jobList.html';
	this.EnterpriseMailList='/enterprise/mailList.html';
	this.EnterpriseMailEdit='/enterprise/mailEdit.html';
	};
diantou.path.prototype={
IgnoreAnswerQuestionPath:function()
	{
	return new diantou.question({Id:74}).Path.Index;
	}
		};

diantou.httpLinkEmpty={
Check:function(Link)
	{
	if(Link.Value)
		{
		if(Link.Value.substring(0,2)=='//')	return true;
		var Http=Link.Value.substring(0,8).toLowerCase();
		return Http.substring(0,7)=='http://'||Http=='https://';
		}
	return true;
	}
		};

diantou.image=function(Value)
	{
    this.Type=Value.Type;
	if(this.Value=Value.Value)	this.IsFull=diantou.httpLinkEmpty.Check(this);
	};
diantou.image.prototype={
Set:function(Type,Target)
	{
	this.Type=Type;
	this.Target=Target;
	},
GetDomain:function()	{	return this.Type=='examUser'?'//photo.51nod.com/':'//__IMAGEDOMAIN__/';	},
Full:function()
	{
	if(this.Value)	return this.IsFull?this.Value:null;
	switch(this.Type)
		{
		case 'user':	return '//__STATICDOMAIN__/Images/Default/'+(this.Target.Sex=='Female'?'female':'male')+'.jpg';
		case 'topic':	return '//__STATICDOMAIN__/Images/Default/topic.png';
		case 'enterprise':	return '//__STATICDOMAIN__/Images/Default/companylogo.png';
		case 'examUser':	return '//__STATICDOMAIN__/Images/Default/'+(this.Target.Sex=='女'?'female':'male')+'.jpg';
		case 'exam':	return '//__STATICDOMAIN__/images/exam/exambg.jpg';
		}
	},
Src:function()	{	return this.Full()||(this.GetDomain()+this.Value);	},
P25:function()	{	return this.Full()||(this.GetDomain()+'ti_25_25/'+this.Value);	},
P40:function()	{	return this.Full()||(this.GetDomain()+'ti_40_40/'+this.Value);	},
P50:function()	{	return this.Full()||(this.GetDomain()+'ti_50_50/'+this.Value);	},
P100:function()	{	return this.Full()||(this.GetDomain()+'ti_100_100/'+this.Value);	},
P150:function()	{	return this.Full()||(this.GetDomain()+'ti_150_150/'+this.Value);	},
P200:function()	{	return this.Full()||(this.GetDomain()+'ti_200_200/'+this.Value);	},
W100:function()	{	return this.Full()||(this.GetDomain()+'ti_100_/'+this.Value);	},
W100H150:function()	{	return this.Full()||(this.GetDomain()+'ti_100_150/'+this.Value);	}
		};